<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Config extends Model
{
    protected $table = 'config';
    protected $primaryKey = 'id';

    public static function indexConfig()
    {
        return self::first();
    }

    public static function indexConfigUpdate($title,$title_simple,$keywords,$description,$description_simple,$address,$phone,$email,$weibo,$qq,$wechat,$top_imgs,$wechat_code,$download_code,$bottoms,$logo,$color,$metas,$statistics)
    {
        return self::where("id",1)->update(["title"=>$title,"title_simple"=>$title_simple,"keywords"=>$keywords,"description"=>$description,"description_simple"=>$description_simple,"address"=>$address,"phone"=>$phone,"email"=>$email,"weibo"=>$weibo,"qq"=>$qq,"wechat"=>$wechat,"top_imgs"=>$top_imgs,"wechat_code"=>$wechat_code,"download_code"=>$download_code,"wechat_code"=>$wechat_code,"bottoms"=>$bottoms,"logo"=>$logo,"color"=>$color,"metas"=>$metas,"statistics"=>$statistics]);
    }
}
